package com.huins.android.intent;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MyIntent extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		Button myButton = (Button) findViewById(R.id.button);
		myButton.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				/*Intent i = new Intent();
				i.setAction("android.intent.action.MAIN");
				i.addCategory("android.intent.category.HUINS_INTENT_TEST");
				startActivity(i);*/
				Intent intent = new Intent(MyIntent.this, MyIntent2.class);
				startActivity(intent);
			}
		});
		Button dial = (Button) findViewById(R.id.button3);
		dial.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				/*Intent i = new Intent();
				i.setAction("android.intent.action.MAIN");
				i.addCategory("android.intent.category.HUINS_INTENT_TEST");
				startActivity(i);*/
				Intent intent = new Intent(Intent.ACTION_DIAL);
				intent.setData(Uri.parse("tel:01041265246"));
				startActivity(intent);
			}
		});
		Button web = (Button) findViewById(R.id.button4);
		web.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				/*Intent i = new Intent();
				i.setAction("android.intent.action.MAIN");
				i.addCategory("android.intent.category.HUINS_INTENT_TEST");
				startActivity(i);*/
				Intent intent = new Intent(Intent.ACTION_VIEW);
				intent.setData(Uri.parse("http://m.naver.com"));
				startActivity(intent);
			}
		});
	}
}
